package parser;

import messages.Message;

public class GetBuddyListMessage extends Message
{
	private String type;
	private String username;
	
	public GetBuddyListMessage() {}
	public GetBuddyListMessage(String type, String username)
	{
		super("ReturnStatus");
		this.type = type;
		this.username = username;
	}
	

	public void setType(String type) {this.type = type;}
	public void setUsername(String username) {this.username = username;}
	
	public String getType() {return type;}
	public String getUsername() {return username;}
	
	public void printMessage()
	{
		System.out.println("Message (username: " + username + ") (BuddyList requested)");
//		System.out.println("Sent at: " + timestamp);
//		System.out.println("Text: " + text);
//		System.out.println("User: " + username + " updated his/her status : " + from + " Added Buddy - " + to);
		System.out.println();
	}
	
	// return an XML-formatted version of the message
	public String toXML()
	{
		String message = "<message>";
        message += "<type>GetBuddyList</type>";
        message += "<username>" + username + "</username>";
        message += "</message>";
        
        return message;
	}
}
